﻿using System;
using System.Data;
using VIT.DataHelper.DataAccess;
using System.Text;
using System.Collections.Generic;
using System.Data.SqlClient;

namespace VIT.Web.Modules.SlideshowNumber
{
    public class SlideshowProvider
    {
        SQLSupport sqlSupport = new SQLSupport();

        #region Properties
        public int Id { get; set; }
        public string LanguageId { get; set; }
        #endregion

        public DataTable getLogos(Dictionary<string, string> param)
        {
            string Position;
            try { Position = param["Position"]; }
            catch { Position = string.Empty; }

            if (Position.Length > 0)
            {
                string strQuery = "select FileName, Title, Link From Logo Where LanguageID=@LanguageID and PositionId=@PositionId and Published=1 order by Orders, ModifyDate desc";
                SqlParameter LanguageId = new SqlParameter("@LanguageID", this.LanguageId);
                SqlParameter PositionId = new SqlParameter("@PositionId", Position);
                return sqlSupport.ExecuteDataset(false, strQuery, LanguageId, PositionId).Tables[0];
            }
            else return null;
        }
    }
}